<template>
  <div class="container">
    <el-empty :description="description"/>
    <nuxt-link :to="{name:'index'}" style="margin-top: 10px">返回首页</nuxt-link>
    <el-button v-if="error.statusCode===401" type="text" @click="$parent.$parent.showLogin()">点击登录</el-button>
  </div>
</template>

<script>
export default {
  name: "error",
  props: ["error"],
  layout: "base",
  computed: {
    description() {
      if (this.error.statusCode === 404) {
        return "404，页面没有找到~"
      } else {
        return `${this.error.statusCode}，${this.error.message}`;
      }
    }
  },
  head() {
    // Set Meta Tags for this Page
  }
}
</script>

<style scoped>
.container {
  padding: 150px;
  text-align: center;
}
</style>
